/*
 *  UsageCodeComp.cpp
 *  Typeface Builder
 *
 *  Created by David Rowland on 01/12/2008.
 *  Copyright 2008 UWE. All rights reserved.
 *
 */

#include "UsageCodeComp.h"
#include "TabComponent.h"

UsageCodeComp::UsageCodeComp ()
{
	addAndMakeVisible (titleText = new TextEditor (T("titleText")));
	titleText->setMultiLine (true);
	titleText->setReturnKeyStartsNewLine (false);
	titleText->setReadOnly (true);
	titleText->setScrollbarsShown (false);
	titleText->setCaretVisible (false);
	titleText->setPopupMenuEnabled (false);
	titleText->setFont(Font(18.0f));
	titleText->setColour (TextEditor::backgroundColourId, Colour (0xffffff));
	titleText->setColour (TextEditor::shadowColourId, Colour (0x0));
	titleText->setText (T("Use this section of code to load your typeface into your application and then use it as you would any other font."));
	
	addAndMakeVisible (generatedCode = new TextEditor (T("generatedCode")));
	generatedCode->setMultiLine (true);
	generatedCode->setReturnKeyStartsNewLine (false);
	generatedCode->setReadOnly (true);
	generatedCode->setScrollbarsShown (true);
	generatedCode->setCaretVisible (false);
	generatedCode->setPopupMenuEnabled (true);
}

UsageCodeComp::~UsageCodeComp ()
{
	deleteAllChildren();
}

void UsageCodeComp::resized()
{
	titleText->setBounds (0, 0, getWidth(), 45);
	generatedCode->setBounds (0, 50, getWidth(), getHeight() );
}

//================================================================================